package com.fnzn.entranceGuard.mapper;


import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.fnzn.entranceGuard.entity.GuardDevice;
import com.fnzn.entranceGuard.entity.GuardRoleDevice;
import com.fnzn.entranceGuard.vo.CommunityVo;
import com.fnzn.entranceGuard.vo.GuardRole;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *   Mapper 接口
 * </p>
 *
 * @author sxf
 * @since 2018-06-26
 */
@Repository
public interface GuardRoleDeviceMapper extends BaseMapper<GuardRoleDevice> {

    List<GuardDevice> selectDeviceByGroupId(@Param("groupId") String groupId);

    void deleteByRoleId(@Param("groupId") String id);

    List<GuardRole> getByUserId(@Param("userId") String userId);

    /**
     * 获取当前用户的社区
     * @param userId
     * @return
     */
    List<CommunityVo> getCommunityByUserId(String userId);

    List<GuardRole> getDeviceIdsByHouseOwnerId(@Param("houseOwnerId") String houseOwnerId);

    List<GuardRole> getDeviceIdsByUserId(@Param("userId") String userId);

    List<GuardRoleDevice> selectByRoleId(@Param("roleId")String rid);
}